﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Repeater控件.aspx.cs" Inherits="ProjectStudy.Pepeater控件" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Repeater ID="Repeater1" runat="server" 
            onitemcommand="btnDeleteOneData">
         <HeaderTemplate>
           <table cellpadding="0" cellspacing="0" border="1">
           <tr>
           <th><input  type="checkbox" id="chkAll"/></th>
           <th>班级ID</th>
           <th>班级名称</th>
           <th>班级描述</th>
           <th>删除标记</th>
           <th>删除</th>
           <th>编辑</th>
           </tr>
           
         </HeaderTemplate>
            <ItemTemplate>
             <tr>
             <td><input  type="checkbox"/></td>                
              <td><asp:Label ID="Label1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "id") %>'></asp:Label></td>
              <td><asp:Label ID="Label2" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "className") %>'></asp:Label></td>
              <td><asp:Label ID="Label3" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "classDesc") %>'></asp:Label></td>
              <td><asp:Label ID="Label4" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "isDel") %>'></asp:Label></td>
              <td><asp:Button ID="Button1" runat="server" OnClientClick="return confirm('确定删除？');"  Text="删除" CommandName="DelItem"/></td>
              <td><asp:Button ID="Button2" runat="server" Text="编辑" CommandName="EditItem"/></td>
           </tr>  
            
            
            </ItemTemplate>
            <AlternatingItemTemplate>
            <tr bgcolor="lightblue"> 
              <td><input  type="checkbox"/></td>                  
              <td><asp:Label ID="Label1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "id") %>'></asp:Label></td>
              <td><asp:Label ID="Label2" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "className") %>'></asp:Label></td>
              <td><asp:Label ID="Label3" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "classDesc") %>'></asp:Label></td>
              <td><asp:Label ID="Label4" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "isDel") %>'></asp:Label></td>
              <td>
                  <asp:Button ID="Button1" runat="server" OnClientClick="return confirm('确定删除？');" Text="删除" CommandName="DelItem"/></td>
                  <td><asp:Button ID="Button2" runat="server"  Text="编辑" CommandName="EditItem"/></td>
           </tr>  
            
            </AlternatingItemTemplate>
            <FooterTemplate>
            </table>
            </FooterTemplate>
        </asp:Repeater>
        <br />
        <br />
        <asp:Label ID="Label5" runat="server" Text=""></asp:Label>
    </div>
    </form>
</body>
</html>
